<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <title>用户登录</title>
    <style>
        /* 基本样式 */
        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f9f9f9;
            margin: 0;
            padding: 0;
            color: #333;
        }

        .container {
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
        }

        h1 {
            text-align: center;
            color: #3a7d44;
            font-size: 28px;
            margin: 30px 0;
            font-weight: 600;
        }

        h2 {
            color: #3a7d44;
            font-size: 24px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e8f5e9;
            padding-bottom: 10px;
        }

        /* 优化的卡片样式 */
        .row {
            display: flex;
            flex-wrap: wrap;
            margin: 0 -10px;
        }

        .col {
            flex: 0 0 calc(50% - 20px);
            margin: 10px;
            box-sizing: border-box;
        }

        .card {
            background-color: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        }

        .card-body {
            padding: 20px;
        }

        .card-title {
            font-size: 18px;
            color: #333;
            margin-top: 0;
            margin-bottom: 10px;
        }

        .card-text {
            color: #666;
            margin-bottom: 15px;
            font-size: 15px;
            line-height: 1.6;
        }

        .card-footer {
            border-top: 1px solid #f0f0f0;
            padding: 15px 20px;
            font-size: 14px;
            color: #777;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .btn {
            padding: 6px 14px;
            border-radius: 20px;
            background-color: #4caf50;
            color: white;
            text-decoration: none;
            font-size: 14px;
            transition: background-color 0.3s;
        }

        .btn:hover {
            background-color: #388e3c;
        }

        /* 清新风格的配色和排版 */
        .alert-info {
            background-color: #e3f2fd;
            color: #1976d2;
            border-left: 4px solid #64b5f6;
            padding: 15px;
            margin: 10px 0;
            border-radius: 8px;
        }

        .button-group {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 30px;
        }

        .btn-light {
            background-color: #e8f5e9;
            color: #3a7d44;
            border: 1px solid #c8e6c9;
            padding: 8px 20px;
            border-radius: 20px;
            font-weight: 500;
            transition: all 0.3s;
        }

        .btn-light:hover {
            background-color: #c8e6c9;
        }

        /* 文本优化 */
        .article-meta {
            color: #777;
            font-size: 14px;
        }

        /* 响应式优化 */
        @media (max-width: 768px) {
            .col {
                flex: 0 0 100%;
            }

            .card {
                margin: 10px 0;
            }
        }
    </style>
    <!-- 引入公共样式 -->
</head>
<body>
<div class="container">
    <h1>欢迎来到管理员登录页面</h1>
    <div class="button-group">
        <a th:href="@{/user/index}" class="btn btn-light">返回首页</a>
        <a th:href="@{/category}" class="btn btn-light">分类功能</a>
    </div>
    <!-- 文章列表 -->
    <h2 class="mb-4">待审核文章</h2>

    <div class="row row-cols-1 row-cols-md-2 g-4">
        <div class="col" th:each="article : ${articles}">
            <div class="card h-100 shadow-sm">
                <div class="card-body">
                    <h5 class="card-title article-title" th:text="${article.title}">文章标题</h5>
                    <p class="card-text text-truncate" th:text="${#strings.abbreviate(article.content, 100)}">文章内容摘要...</p>
                </div>
                <div class="card-footer d-flex justify-content-between align-items-center">
                    <small class="text-muted article-meta">
                        作者：[[${article.username}]] |
                        分类：[
                        <span th:each="category : ${categories}"
                              th:if="${category.id == article.categoryId}"
                              th:text="${category.name}">
                            </span>
                        ] |
                        阅读量：[[${article.viewCount}]]
                    </small>
                    <a th:href="@{/admin/article/{id}(id=${article.id})}" class="btn btn-sm btn-outline-primary">查看详情</a>
                </div>
            </div>
        </div>

        <!-- 如果没有文章 -->
        <div class="alert alert-info" th:if="${#lists.isEmpty(articles)}">
            暂无文章。
        </div>

    </div>
</div>
</body>
</html>